//
//  UserInfo.m
//  StockWin
//
//  Created by showshaw on 15/6/11.
//  Copyright (c) 2015年 ZhongQian. All rights reserved.
//

#import "UserInfo.h"


@implementation UserInfo
#pragma mark - 单例方法
//静态全局变量,用于返回对应的单例
static id _instance;
/**
 *  类方法,返回单例实例
 */
+(instancetype)sharedUserInfo
{
    //此方法会调用allocWithZone
    return [[self alloc] init];
}

/**
 *  返回唯一实例
 */
+(instancetype)allocWithZone:(struct _NSZone *)zone
{
    static dispatch_once_t once;
    dispatch_once(&once, ^{
        _instance = [super allocWithZone:zone];
    });
    return _instance;
}

-(id)copyWithZone:(struct _NSZone *)zone
{
    return _instance;
}


@end
